<template>
	<view>
		<view>
			<view
				style="background: url(https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/e63bcf73858e37c567847ca55821ddfa.png) no-repeat;background-size: 100%;width: 100%;height: 414rpx;">

			</view>
			<view style="width: 100%;position: absolute;top:10rpx;left: 0%;padding-bottom: 30rpx;">
				<view style="position: relative;width: 92%;margin: 0 auto;">
					<input type="text"   v-model="keywords" class="sou" placeholder-class="suo"
						placeholder="找人/找货/搜信息" confirm-type="search" @confirm="search" />
					<image
						src="https://dyeego.oss-cn-beijing.aliyuncs.com/uploads/20220325/91243acc628efa1338d3d38826d22484.png"
						class="souicon" mode=""></image>
				</view>

				<view class="fenlei" style="width: 92%;margin: 20rpx auto;">
					<swiper :indicator-dots="fl_xianshi" :class="['swiper',gaodu?'da_gao':'xiao_gao']">
						<swiper-item>
							<u-grid :border="false">
								<u-grid-item @click="tz_dianji(index,item.id,item.is_child,item.name)" :customStyle="{width:138+'rpx',height:138+'rpx'}"
									v-for="(item, index) in yuan_list1.slice(0,10)" :index="index" :key="index">
									<image :src="item.main_image" style="width: 80rpx;height: 80rpx;" mode=""></image>
									<view :class="index==tabindex?'actives':'as'"
										style="font-size: 24rpx;line-height: 30rpx;">
										{{item.name}}
									</view>
								</u-grid-item>
							</u-grid>
						</swiper-item>
						<swiper-item v-if="yuan_list1.length>10">
							<u-grid :border="false">
								<u-grid-item @click="tz_dianji(index+10,item.id,item.is_child,item.name)"
									:customStyle="{width:138+'rpx',height:138+'rpx'}"
									v-for="(item, index) in yuan_list1.slice(10,20)" :index="index + 10" :key="index">
									<image :src="item.main_image" style="width: 80rpx;height: 80rpx;" mode=""></image>
									<view :class="index+10==tabindex?'actives':'as'"
										style="font-size: 24rpx;line-height: 30rpx;">
										{{item.name}}
									</view>
								</u-grid-item>
							</u-grid>
						</swiper-item>
						<swiper-item v-if="yuan_list1.length>20">
							<u-grid :border="false">
								<u-grid-item @click="tz_dianji(index+20,item.id,item.is_child,item.name)"
									:customStyle="{width:138+'rpx',height:138+'rpx'}"
									v-for="(item, index) in yuan_list1.slice(20,30)" :index="index + 20" :key="index">
									<image :src="item.main_image" style="width: 80rpx;height: 80rpx;" mode=""></image>
									<view :class="index+20==tabindex?'actives':'as'"
										style="font-size: 24rpx;line-height: 30rpx;">
										{{item.name}}
									</view>
								</u-grid-item>
				   </u-grid>
						</swiper-item>
					</swiper>

				</view>


				<view class="sticky-box"
				style="background-color: #F8F8F8;padding: 20rpx 60rpx 20rpx 30rpx;width: 100%;box-sizing: border-box;">

					<!-- <vgt-tab class="tab-xxx" :list="list2" :defaultChoseInd="100" defaultChoseItem=""
						@onValueChange="handleValueChange2" /> -->

					<!-- <scroll-view id="tab-bar" class="scroll-h" :scroll-x="true" :show-scrollbar="false" :scroll-into-view="scrollInto">
							<view v-for="(item,index) in yuan_list2" :key='item.id' class="uni-tab-item" :id="item.ids" :data-current="index" @click="handleValueChange2(index)">
							    <text class="uni-tab-item-title" :class="qh_type==index ? 'uni-tab-item-title-active' : ''">{{item.name}}</text>
								<image v-if="qh_type==index" src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230411/2176b3fec852179c4610f402fdac0589.png" style="width: 100rpx;height: 12rpx;position: absolute;left: 50%;bottom: 16rpx;transform: translateX(-50%);"  mode=""></image>
							</view>
					</scroll-view> -->
					<view style="width: 100%;overflow: hidden;" class="renmen">
						<view @click="fl_xuanze(index)" :class="item.check?'active_fl':'a_fl'" v-for="(item,index) in list5" :key='index' style="width: 170rpx;height: 64rpx;line-height: 64rpx;text-align: center;background-color: #fff;float: left;border-radius: 10rpx;position: relative;">
							{{item.name || ''}}
						</view>
					</view>
					<image @click="more" src="https://static-1310167831.cos.ap-nanjing.myqcloud.com//uploads/20220620/2cad39e07bbeef97a9f4642094f55b69.png" style="width: 50rpx;height: 50rpx;position: absolute;top: 50%;right: 30rpx;transform: translateY(-50%);" mode=""></image>
				</view>
				<!-- <view  v-for="(item,index) in list" :key='index' style="box-sizing: border-box;padding: 30rpx;background-color: #FFFFFF;margin-top: 26rpx;border-radius: 12rpx;">
				<view style="overflow: hidden;">
					<view @click="yonghu_xx(item.user_id)" style="width: 18%;float: left;overflow: hidden;">
						<image :src="item.user.avatar" style="width: 92rpx;height: 92rpx;border-radius: 50%;display: block;" mode=""></image>
					</view>
					<view @click="tzxq(item.id)" style="width: 82%;float: left;padding: 6rpx 0;">
						<view style="height: 40rpx;line-height: 40rpx;">
							<text style="color: #000000;font-size: 30rpx;display: inline-block;width: 200rpx;font-weight: 600;" class="yihang">{{item.user.nickname}}</text>
							<text style="color: #999999;font-size: 24rpx;float: right;">发布于 {{item.create_time}}</text>
						</view>
						<view style="height: 40rpx;line-height: 40rpx;color: #999999;font-size: 24rpx;" class="yihang">
							{{item.user.company || ''}}
						</view>
					</view>
				</view>
				<view @click="tzxq(item.id)">
					<view style="color: #666666;font-size: 28rpx;line-height: 40rpx;margin-top: 20rpx;" class="erhang">
						{{item.main_content}}
					</view>
					<view style="overflow: hidden;margin-top: 20rpx;" class="tu" v-if="item.main_images">
						<view v-for="(a,b) in item.main_images" :key='b' style="width: 190rpx;height: 190rpx;float: left;border-radius: 16rpx;overflow: hidden;">
							<image :src="a" style="width: 100%;height: 100%;left: 0;" mode="aspectFill"></image>
						</view>

					</view>
					<view style="line-height: 80rpx;display: flex;">
						<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
							<image src="@/static/index/icon_collect.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
							收藏({{item.collect_num}})

						</view>
						<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
							<image src="@/static/index/icon_comment.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
							评论({{item.comment_num}})

						</view>
						<view style="flex: 1;color: #999999;font-size: 24rpx;box-sizing: border-box;padding-left: 60rpx;position: relative;">
							<image src="@/static/index/icon_like.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;left: 20rpx;transform: translateY(-50%);" mode=""></image>
							点赞({{item.like_num}})

						</view>
					</view>
				</view>
			</view> -->

				<view v-for="(item,index) in list" :key='index'
					style="width: 92%;margin: 20rpx auto;padding: 30rpx;box-sizing: border-box;border-radius:16rpx;background-color: #FFFFFF;">
					<view style="overflow: hidden;">
						<view @click="yonghu_xx(item.user_id,item.type,item.firm_id)"
							style="width: 80rpx;height: 80rpx;float: left;margin-right: 30rpx;position: relative;">
							<image :src="item.user.avatar"
								style="width: 80rpx;height: 80rpx;display: block;border-radius: 12upx;overflow: hidden;"
								mode=""></image>
							<image v-if="item.user.is_vip==1 && item.type==2"
								src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/ren.png"
								style="width: 30rpx;height: 30rpx;position: absolute;right: -10rpx;bottom: -10rpx;z-index: 4;"
								mode=""></image>
							<image v-if="item.user.is_vip==2 && item.type==2"
								src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220616/ce4d9a4e5c9d814d939dc3324abc44d6.png"
								style="width: 30rpx;height: 30rpx;position: absolute;right: -10rpx;bottom: -10rpx;z-index: 4;"
								mode=""></image>
							<image v-if="item.type==1"
								src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220616/daf7dad493b169a57961fac90302d9be.png"
								style="width: 30rpx;height: 30rpx;position: absolute;right: -10rpx;bottom: -10rpx;z-index: 4;"
								mode=""></image>
						</view>
						<view style="width: 82%;float: left;">
							<view style="line-height: 50rpx;margin-bottom: 10rpx;overflow: hidden;">
								<text v-if="item.user.is_vip==2"
									style="color: #2B85E4;font-size: 30rpx;display: block;max-width: 300rpx;float: left;"
									class="yihang">

									<text v-if="item.user.remark_name!=''">{{item.user.remark_name || ''}}</text>
									<text v-if="item.user.remark_name!=''" style="margin-left: 10rpx;font-size: 26rpx;">{{item.user.name || ''}}</text>
									<text v-if="item.user.remark_name==''">{{item.user.name || ''}}</text>
									</text>
								<text v-if="item.user.is_vip==1"
									style="color: #F29100;font-size: 30rpx;display: block;max-width: 300rpx;float: left;font-weight: 600;"
									class="yihang">

									<text v-if="item.user.remark_name!=''">{{item.user.remark_name || ''}}</text>
									<text v-if="item.user.remark_name!=''" style="margin-left: 10rpx;font-size: 26rpx;">{{item.user.name || ''}}</text>
									<text v-if="item.user.remark_name==''">{{item.user.name || ''}}</text>
								</text>
								<!-- <image @click="yonghu_xx(item.user_id)"
									src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/shenfen.png"
									style="width: 28rpx;height: 22rpx;float: left;margin-top: 14rpx;margin-left: 20rpx;"
									mode=""></image> -->
							</view>
							<view style="overflow: hidden;">
								<text class="xiao" style="color: red;" v-if="item.is_top==1">置顶</text>
								<text v-if="item.tips_manage.length>0" v-for="(a,b) in item.tips_manage" :key='b' class="xiao">{{a.name}}</text>
							</view>
							<!-- <view style="height: 30rpx;line-height: 30rpx;color: #999999;font-size: 24rpx;"
							class="yihang">
							{{item.user.company || ''}}
						</view> -->
						</view>
					</view>
					<view @click="tzxq(item.id)"
						style="color: #000000;font-size: 28rpx;line-height: 40rpx;margin: 16rpx 0 0;">
						<!-- <view class="sanhang">{{item.main_content}}</view> -->
						<view class="sihang">
							<text>{{item.main_content || ''}}</text>
						</view>
						<view v-if="item.more_check" style="line-height: 40rpx;color: #1fb0ac;font-size: 26rpx;">
							查看更多>
						</view>
					</view>
					<view @click="tzxq(item.id)" style="overflow: hidden;" class="tu">
						<view v-for="(a,b) in item.main_images" :key='index'
							style="width: 190rpx;height: 190rpx;float: left;border-radius: 16rpx;overflow: hidden;">
							<image :src="a" style="width: 100%;height: 100%;left: 0;" mode="aspectFill"></image>
						</view>

					</view>
					<view @click="tzxq(item.id)" style="overflow: hidden;margin: 20rpx 0 0;">
						<text
							style="color: #999999;font-size: 26rpx;float: left;display: block;width: 280rpx;line-height: 60rpx;">{{item.create_time}}</text>
						<view style="float: right;line-height: 60rpx;">
							<image
								src="@/static/index/icon_collect.png"
								style="width: 36rpx;height: 36rpx;float: left;margin-top: 12rpx;margin-right: 6rpx;"
								mode=""></image>
							<text style="color: #000000;font-size: 24rpx;float: left;margin-right: 14rpx;">
								{{item.collect_num>10000?( (item.collect_num/10000).toFixed(1)+'万' ):item.collect_num || 0}}
							</text>
						</view>
						<view style="float: right;line-height: 60rpx;margin-right: 10rpx;">
							<image
								src="@/static/index/icon_comment.png"
								style="width: 36rpx;height: 36rpx;float: left;margin-top: 12rpx;margin-right: 6rpx;"
								mode=""></image>
							<text style="color: #000000;font-size: 24rpx;float: left;margin-right: 14rpx;">
								{{item.comment_num>10000?( (item.comment_num/10000).toFixed(1)+'万' ):item.comment_num || 0}}
							</text>
						</view>
						<view style="float: right;line-height: 60rpx;margin-right: 10rpx;">
							<image
								src="@/static/index/icon_like.png"
								style="width: 36rpx;height: 36rpx;float: left;margin-top: 12rpx;margin-right: 6rpx;"
								mode=""></image>
							<text style="color: #000000;font-size: 24rpx;float: left;margin-right: 14rpx;">
								{{item.like_num>10000?( (item.like_num/10000).toFixed(1)+'万' ):item.like_num || 0}}
							</text>
						</view>

					</view>

				</view>

				<view style="text-align: center;margin-top: 50rpx;">
					<image v-if="kk"
						:src="require('@/static/my/no-data.png')"
						style="width: 334rpx;" mode="widthFix"></image>
					<view style="width: 80%;margin: 0 auto;">
						<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="暂无数据"
							v-if="list.length==0"></u-divider>
						<u-divider color='#717171' bg-color='#f0f2f8' height='80' border-color='#717171' text="没有更多了"
							v-if="list.length>0 && enmpy"></u-divider>
					</view>
				</view>
			</view>
		</view>

		<u-popup :show="top_show" mode="top" :round="10"  @close="top_close">
		    <view style="box-sizing: border-box;padding: 30rpx 0 0;">
		        <view style="padding: 0 30rpx;">
		        	<view style="line-height: 60rpx;color: #333333;font-size: 30rpx;margin-bottom: 20rpx;">
		        		筛选条件
		        	</view>
		        	<view @click="xz_weizhi" style="line-height: 70rpx;display: flex;font-size: 24rpx;color: #666666;background-color: #f8f8f8;border-radius: 10rpx;box-sizing: border-box;padding: 0 20rpx;margin-bottom: 14rpx;">
		        		<view style="flex: 1;font-size: 24rpx;color: #000000;">
		        			位置选择
		        		</view>
		        		<view style="flex: 2;text-align: right;box-sizing: border-box;padding-right: 40rpx;position: relative;">
		        			{{index_wz || ''}}
		        			<image src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230410/7b4a9ac7b1fb567c0f1c9cbf80edda78.png" style="width: 30rpx;height: 30rpx;position: absolute;top: 50%;right: 0;transform: translateY(-50%);" mode=""></image>
		        		</view>
		        	</view>
		        	<!-- <view @click="tz_lx" style="line-height: 90rpx;display: flex;font-size: 28rpx;border-bottom: 1px solid #eeeeee;color: #666666;">
		        		<view style="flex: 1;">
		        			帖子类型
		        		</view>
		        		<view style="flex: 2;text-align: right;">
		        			{{tz_leixing || '请选择类型'}}<text style="font-size: 28rpx;" class="iconfont icon-xiangyou"></text>
		        		</view>
		        	</view> -->
		        	<view>
		        		<view style="line-height: 60rpx;font-size: 22rpx;color: #999999;">
		        			帖子类型
		        		</view>
		        		<view style="overflow: hidden;" class="more_sx">
		        			<view @click="xuanze_lei(index)" :class="item.check?'sx_active':'sx_as'" v-for="(item,index) in list2" :key='index' style="width: 330rpx;float: left;box-sizing: border-box;line-height: 70rpx;text-align: center;font-size: 24rpx;border-radius: 8rpx;">
		        				{{item.name}}
		        			</view>
		        		</view>
		        	</view>
		        	<view>
		        		<view style="line-height: 60rpx;font-size: 22rpx;color: #999999;">
		        			发布人身份
		        		</view>
		        		<view style="overflow: hidden;" class="more_sx">
		        			<view @click="sxtj(index)" :class="item.check?'sx_active':'sx_as'" v-for="(item,index) in sx_list" :key='index' style="width: 330rpx;float: left;box-sizing: border-box;line-height: 70rpx;text-align: center;font-size: 24rpx;border-radius: 8rpx;">
		        				{{item.name}}
		        			</view>
		        		</view>
		        	</view>

		        </view>
				<view style="margin-top: 30rpx;display: flex;line-height: 100rpx;">
					<view @click="sx_chongzhi" style="flex: 1;height: 100rpx;font-size: 30rpx;color: #333333;text-align: center;border-radius:0 0 0 20rpx;background-color: #F1F1F1;">
						取消
					</view>
					<view @click="sx_wancheng" style="flex: 1;height: 100rpx;font-size: 30rpx;color: #FFFFFF;text-align: center;border-radius:0 0 20rpx 0;background-color: #5EC4C2;">
						确定
					</view>
				</view>
		    </view>
		</u-popup>

	</view>
</template>

<script>
	import vgtTab from '@/components/vgt-tab.vue'
	export default {
		components: {
			vgtTab
		},
		data() {
			return {
				list2: [],
				yuan_list2: [],
				list1: [],
				yuan_list1: [],
				id: '',
				pid: '',
				keywords: '',
				page: 1,
				list: [],
				enmpy: false,
				kk: false,
				name: '',
				fl_xianshi: false,
				tabindex: 0,
				category_id: '',
				gaodu:false,
				top_show:false,
				index_wz:'',
				tz_leixing:'',
				tzlx_id:'',
				sx_list:[
					{
						name:'个人',
						check:false,
						id:1
					},
					{
						name:'企业',
						check:false,
						id:2
					}
				],
				sx_id:[],
				scrollInto:'',
				qh_type:0,
				yuan_list5:[],
				list5:[],
				order_type:''
			}
		},
		onLoad(option) {
			this.tzxuanze_fl()
			if (option.voice_category_id) {
				this.id = option.voice_category_id
			}
			if (option.voice_manage_id) {
				this.pid = option.voice_manage_id
				this.tz_fl()
			}
			this.tzfl()
			this.name = option.name
			uni.setNavigationBarTitle({
				title: option.name
			})

		},
		onReachBottom: function() {
			console.log(222222222)
			if (this.enmpy) {
				return
			} else {
				this.tiezi()
			}
		},
		methods: {

			tzxuanze_fl: function() {
				this.post('api/index/index_voice_category', '', true).then(res => {
					console.log(res)
					if (res.code == 1) {
						// let arr = [{
						// 	name: '全部',
						// 	id: ''
						// }]
						this.yuan_list5 = res.data
						this.order_type=this.yuan_list5[0].id
						console.log(this.yuan_list5,222222222222)
						// for (let i = 0; i < this.yuan_list1.length; i++) {
						// 	this.list1.push(this.yuan_list1[i].name)
						// }
						for (let i = 0; i < this.yuan_list5.length; i++) {
							this.list5.push({name:this.yuan_list5[i].name,check:false})
						}
						console.log(this.list5,1111111)
						this.list5[0].check=true

					}
				})
			},


			xuanze_lei:function(index){
				let that=this
				// console.log(111111111111)
				// uni.showActionSheet({
				// 	itemList: that.list1,
				// 	success: function (res) {
				// 		console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
				// 		// let index = res.tapIndex
				// 		that.category_id = that.yuan_list1[res.tapIndex].id
				// 		that.tiezi_lx=that.yuan_list1[res.tapIndex].name
				// 	},
				// 	fail: function (res) {
				// 		console.log(res.errMsg);
				// 	}
				// });
				for(let i=0;i<this.list2.length;i++){
					if(index==i){
						this.list2[i].check=true
					}else{
						this.list2[i].check=false
					}
				}
				console.log(this.list2,123456)
				this.category_id = this.yuan_list2[index].id
			},

			// 弹出层选择位置
			xz_weizhi:function(){
				uni.navigateTo({
					url:'../../../subpages/pages/index_weizhi'
				})
			},
			// 帖子分类
			tz_lx:function(){
				uni.navigateTo({
					url:'../../../subpages/pages/index_tzfl'
				})
			},
			sxtj:function(index){
				this.sx_list[index].check=!this.sx_list[index].check
				if(this.sx_id.length<=0){
					this.sx_id.push(this.sx_list[index].id)
				}else{
					for(let i=0;i<this.sx_id.length;i++){
						if(this.sx_id[i]==this.sx_list[index].id){
							this.sx_id.splice(i,1)
							console.log(this.sx_id,258)
							return
						}
					}
					this.sx_id.push(this.sx_list[index].id)
				}
				console.log(this.sx_id,147)
			},
			// 更多三杠
			more:function(){
				this.top_show=true
			},
			top_close:function(){
				this.top_show=false
			},

			sx_chongzhi:function(){
				this.top_show=false
				this.index_wz=''
				this.tz_leixing=''
				this.category_id=''
				this.tzlx_id=''
				this.sx_id=[]
				for(let i=0;i<this.sx_list.length;i++){
					this.sx_list[i].check=false
				}
				for(let i=0;i<this.list2.length;i++){
					this.list2[i].check=false
				}
				this.list = []
				this.kk = false
				this.enmpy = false
				this.page = 1
				this.tiezi()
			},
			sx_wancheng:function(){
				this.top_show=false
				this.list = []
				this.kk = false
				this.enmpy = false
				this.page = 1
				this.tiezi()
			},
			handleValueChange2(index) {
				console.log(index)
				this.qh_type=index
				this.pid = this.yuan_list1[index].id
				this.list = []
				this.kk = false
				this.enmpy = false
				this.page = 1
				this.category_id = this.yuan_list2[index].id
				this.scrollInto = this.yuan_list2[index].ids;
				console.log(6666666666)
				this.tiezi()
			},

			// 帖子分类
			tzfl: function() {
				this.list2=[]
				this.post('api/index/voice_category', {voice_manage_id:this.pid}, true).then(res => {
					console.log(res)
					if (res.code == 1) {
						// let arr = [{
						// 	name: '全部',
						// 	id: ''
						// }]
						this.yuan_list2 = res.data
						console.log(this.yuan_list2)
						for (let i = 0; i < this.yuan_list2.length; i++) {
							// this.yuan_list2[i]['ids']='a'+i
							this.list2.push({name:this.yuan_list2[i].name,check:false})
						}
					}
				})
			},
			// 用户信息
			yonghu_xx: function(id,type,f_id) {
				if(type==1){
					uni.navigateTo({
						url:'../../../subpages/pages/wuliuqiye/wl_qyxq?id='+f_id
					})
				}else{
					uni.navigateTo({
						url: '../wenzhang/yhxx?id=' + id
					})
				}
			},
			// 帖子详情
			tzxq: function(id) {
				uni.navigateTo({
					url: '../wenzhang/wzxq?id=' + id
				})
			},
			// handleValueChange(currentVal) {
			// 	console.log(currentVal)
			// 	this.list=[]
			// 	this.kk=false
			// 	this.enmpy=false
			// 	this.page=1
			// 	this.pid=this.yuan_list1[currentVal.currentInd].id
			// 	this.tiezi()
			// },

			tz_dianji(index,id,status,name) {

				if(status==1){
					uni.navigateTo({
						url:'xialei1?name='+name+'&voice_manage_id='+id
					})
				}else{
					this.qh_type=0
					this.yuan_list2=[]
					this.tabindex = index
					this.list = []
					this.kk = false
					this.enmpy = false
					this.page = 1
					this.pid = this.yuan_list1[index].id
					this.category_id = ''
					this.tzfl()
					this.tiezi()
				}


			},
			fl_xuanze:function(index){

				for(let i=0;i<this.list5.length;i++){
					if(index==i){
						this.list5[i].check=true
					}else{
						this.list5[i].check=false
					}
				}
				this.kk = false
				this.enmpy = false
				this.page = 1
				this.list = []
				this.order_type = this.yuan_list5[index].id
				this.tiezi()
			},
			// 帖子分类
			tz_fl: function() {
				this.post('api/voice/manage', {
					id: this.pid,

				}, true).then(res => {
					console.log(res)
					if (res.code == 1) {
						let arr = [{
							name: '全部',
							id: this.pid,
							main_image: 'https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20230413/8bfd4d306109650a72cdcc7741788c1b.png'
						}]
						this.yuan_list1 = arr.concat(res.data)
						console.log(this.yuan_list1.length)
						if (this.yuan_list1.length > 10) {
							this.fl_xianshi = true
						}
						if(this.yuan_list1.length >5){
							this.gaodu=true
						}
						// for(let i=0;i<this.yuan_list1.length;i++){
						// 	this.list1.push(this.yuan_list1[i].name)
						// }
						// if(this.list1.length>10){
						// 	this.fl_xianshi=true
						// }
						this.tiezi()
					}
				})
			},
			tiezi: function() {
				let data = {
					voice_category_id: this.category_id,
					voice_manage_id: this.pid,
					keywords: this.keywords,
					page: this.page,
					limit: 10,
					longitude: uni.getStorageSync('longitude'),
					latitude: uni.getStorageSync('latitude'),
					province:this.index_wz.split('-')[0],
					city:this.index_wz.split('-')[1],
					district:this.index_wz.split('-')[2],
					// voice_manage_id:this.tzlx_id,
					type:this.sx_id.join(','),
					order_type:this.order_type
				}
				this.post('api/voice', data, true).then(res => {
					if (res.code == 1) {
						if (this.page == 1) {
							if (res.data.data == null || res.data.data.length == 0) {
								this.kk = true
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						} else {
							if (res.data.data == null || res.data.data.length == 0) {
								this.enmpy = true
								return
							} else if (res.data.data.length < 10) {
								this.enmpy = true
							}
						}

						this.page++
						this.list.push(...res.data.data)
						for(let i=0;i<this.list.length;i++){
							this.list[i].num=!this.list[i].main_content.match(/\n/g)?0:this.list[i].main_content.match(/\n/g).length
							if(this.list[i].num>=4 || this.list[i].main_content.length>=88 || (this.list[i].num==3 && this.list[i].main_content.length>=25) || (this.list[i].num==2 && this.list[i].main_content.length>=46) || (this.list[i].num==1 && this.list[i].main_content.length>=67)){
								this.list[i].more_check=true
							}else{
								this.list[i].more_check=false
							}
						}
					} else {
						this.kk = true
						uni.showToast({
							title: res.msg,
							icon: "none",
							duration: 1000
						})
					}
				})
			},
			search: function() {
				this.list = []
				this.kk = false
				this.enmpy = false
				this.page = 1
				this.tiezi()
			}
		}
	}
</script>

<style lang="scss">
	.active_fl{
		color: #1fb0ac;
		font-size: 28rpx;
	}

	.a_fl {
		color: #666666;
		font-size: 28rpx;
	}

	.active_fl::after {
		content: ''; // 必须
		position: absolute;
		left: 50%;
		bottom: 6rpx;
		transform: translateX(-50%);
		width: 80rpx;
		height: 6rpx;
		background-color: #1fb0ac;
	}

	.renmen>view{
		margin-right: 30rpx;
	}
	.u-safe-area-inset-bottom{
		padding-bottom: 0!important;
	}
	.sx_as{
		color: #000000;
		background-color: #F8F8F8;
	}
	.sx_active{
		color: #ffffff;
		background-color: #5EC4C2;
	}
	.more_sx>view{
		margin: 10rpx 28rpx 10rpx 0;
	}
	.more_sx>view:nth-child(2n){
		margin-right: 0;
	}
	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}

	.xiao {
		color: #19BE6B;
		font-size: 20rpx;
		padding: 0rpx 10rpx;
		background: #f3f3f3;
		border-radius: 14rpx;
		display: inline-block;
		height: 30rpx;
		line-height: 30rpx;
		margin-right: 10rpx;
		margin-bottom: 10rpx;
		float: left;
	}

	.actives {
		color: #1fb0ac;
	}

	.as {
		color: #000000;
	}

	.sticky-box {
		/* #ifndef APP-PLUS-NVUE */
		// display: flex;
		position: -webkit-sticky;
		/* #endif */
		position: sticky;
		top: var(--window-top);
		z-index: 100;
		flex-direction: row;
		margin: 0px;
		// position: fixed;
		// top: 0;
		// left: 0;
		// z-index: 100;
	}

	page {
		background-color: #F8F8F8 !important;
		font-family: Demibold;
	}

	.sou {
		width: 100%;
		height: 80rpx;
		line-height: 80rpx;
		border-radius: 40rpx;
		color: #FFFFFF;
		font-size: 26rpx;
		box-sizing: border-box;
		padding: 0 30rpx 0 80rpx;
		background-color: rgba(255, 255, 255, .3);
	}

	.suo {
		color: #FFFFFF;
		opacity: 1;
		font-size: 26rpx;
	}

	.souicon {
		width: 30rpx;
		height: 30rpx;
		position: absolute;
		top: 50%;
		left: 30rpx;
		transform: translateY(-50%);

	}

	.fenlei {
		width: 100%;
		margin: 26rpx 0;
		background-color: #FFFFFF;
		box-sizing: border-box;
		padding: 20rpx 0 10rpx;
		overflow: hidden;
		border-radius: 10rpx;
	}
	.da_gao{
		height: 320rpx;
	}
	.xiao_gao{
		height: 160rpx;
	}

	.tu>view {
		margin: 10rpx 0;
	}

	.tu>view:nth-child(3n+2) {
		margin: 10rpx 30rpx;
	}


	.scroll-h {
	    width: 100%;
		margin: 0 auto;
	    height: 80rpx;
		line-height: 80rpx;
		box-sizing: border-box;
		padding-right: 40rpx;
	    flex-direction: row;
	    /* #ifndef APP-PLUS */
	    white-space: nowrap;
	    /* #endif */
	    /* flex-wrap: nowrap; */
	    /* border-color: #cccccc;
		border-bottom-style: solid;
		border-bottom-width: 1px; */
	}

	.uni-tab-item {
	    /* #ifndef APP-PLUS */
	    display: inline-block;
	    /* #endif */
	    flex-wrap: nowrap;
		/* float: left; */
	    padding-left: 30rpx;
	    padding-right: 30rpx;
		position: relative;
		 display: inline-block;
	}
	.uni-tab-item:after{

	}
	.uni-tab-item:first-child:after{
		background: none;
	}
	.uni-tab-item-title {
	    height: 80rpx;
	    line-height: 80rpx;
	    flex-wrap: nowrap;
		font-size: 30rpx;
		color: #999999;
	    /* #ifndef APP-PLUS */
	    white-space: nowrap;
	    /* #endif */
	}

	.uni-tab-item-title-active {
	    font-weight: 600;
	    font-size: 30rpx;
		color: #000000;
	}
</style>
